package org.tsinghua.answer.domain.question;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

public interface ReplyRepository extends PagingAndSortingRepository<Reply, String> {

	@Query("select r from Reply r join fetch r.creator c where r.question.id = :questionId order by r.createTime ASC")
	public List<Reply> findByQuestionId(@Param("questionId") String questionId);
}
